package pile.pay.mapper;

import org.apache.ibatis.annotations.Param;
import pile.pay.entity.GrantPower;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
 * <p>
 * 发放电量 Mapper 接口
 * </p>
 *
 * @author 郭天义
 * @since 2024-06-29
 */
@Repository
public interface GrantPowerMapper extends BaseMapper<GrantPower> {

    /**
     * 查询用户在该场站下的免费电量  根据电站ID 用户ID 渠道查询  免费电
     * @param memberId
     * @param stationId
     * @param channel
     * @return
     */
    GrantPower selectByMemberIdAndStationId(@Param("memberId") Integer memberId, @Param("stationId") Integer stationId, @Param("channel") Integer channel);

    /**
     * 根据免费电ID 修改免费电 +
     * @param givePower
     * @param grantPowerId
     */
    void updatePower(@Param("givePower")Integer givePower,@Param("grantPowerId")Integer grantPowerId);
}
